Measure invalidation performance and fixes (batching version) #24823
+785
−150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
This is #24532 plus batching of measure invalidation.
I executed a speedscope on davidortinau/AllTheLists
LearningPage
using the latest nightly8.0.99-ci.net8.24468.1
build.What I noticed is that #23052
OnChildMeasureInvalidatedInternal
was showing up and taking 2% of total time (recursive calls).What I've done:
BindingContext
on attached nodes by batching layout invalidation during binding context change & propagationBindingContext
changes, from the leaf to the rootHandler = null
)SetNeedsLayout
propagation issues and cleans up detection of autoSetNeedsLayout
parent propagation withIPropagatesSetNeedsLayout
internal interfaceWinUI Speedscope
Kindly provided by @MartyIX
Before
main
1726728202.MAIN.speedscope.json
After
PR
1726728309.PR.speedscope.json
Before
main
1726728235.MAIN.speedscope.json
After
PR
1726728360.PR.speedscope.json
Android Speedscope
Before
main
android-before.speedscope.json
After
PR
after-android.speedscope.json.zip
iOS Speedscope
Before
main
before.speedscope.json.zip
After
PR
after.speedscope.json.zip
Before
main
You can notice there are some hiccups while scrolling.
before.mp4
After
PR
You can notice there hiccups are basically gone while scrolling, even if in this case I had a lot more nested children.
after.mp4
Issues Fixed
Fixes #24551